<template>
	<view class="order">


		<view class="order_info" style="margin-bottom: 30rpx;">
			<view class="content" v-if="!emptyShow">

				<view v-for="(item, index) in list" :key="index">

					<view class="top border fs-13">
						<view>订单编号:{{item.order_no}}</view>
						<view class="red-font">
							{{item.status_text}}
						</view>
					</view>
					<view>
						<view class="flex detail" @click="toPath(item)">
							<image class="order_img" :src="item.img" mode="aspectFit"></image>
							<view class="order_oneline">
								<view class="">
									<view class="bold two-line">{{item.name}}</view>
									<view class="fs-13 ">下单时间：{{item.createtime}}</view>


								</view>
							</view>
						</view>
						<view class="time" style="text-align: right;">

							<text class="fs-11">合计：</text>
							<text class="red-font bold">￥{{$fixed(item.pay)}}</text>
						</view>
					</view>

				</view>
			</view>
			<view class="bitmap" v-else>
				<image src="../../static/img/no_content.png" mode="aspectFit"></image>
				<view class="gray_font fs-13">
					没有订单信息哦~
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	const app = getApp().globalData;

	const {
		imgRemote,
	} = app;
	export default {
		components: {

		},
		data() {
			return {

				params: {
					page: 1,
					limit: 10
				},
				list: [],
				total: '',
				emptyShow: false

			};
		},
		methods: {
			toPath(e) {
				uni.navigateTo({
					url: '/pages/video/info?id=' + e.kc_id
				})
			},
			getList() {
				this.params.page = 1;
				this.$get(this.$api.KcOrder, this.params, res => {
					let data = res.data;

					if (!data.data.data || data.data.data.length < 1) {
						this.emptyShow = true;
					} else {
						this.emptyShow = false;
					}


					this.list = data.data.data;
					this.total = data.data.total;
				});
			}
		},
		onLoad(e) {
			this.getList();

		},
		onReachBottom() {
			if (this.list.length < this.total) {
				this.params.page++;
				this.$get(this.$api.KcOrder, this.params, res => {
					let data = res.data;
					data.data.data.forEach(ress => {
						this.list.push(ress);
					});
				});
			}
		},
		onShow() {

		}
	};
</script>

<style lang="scss" scoped>
	.order .pay-method {
		padding: 0 20rpx 30rpx;

		.way {
			height: 80rpx;
			line-height: 80rpx;
		}

		.iconfont {
			font-size: 50rpx;
		}

		.submit-order {
			background: #FF7133;
			width: 200rpx;
			color: white;
			text-align: center;
			height: 60rpx;
			border-radius: 10rpx;
			line-height: 60rpx;
			margin: 0 auto;
		}
	}

	.order .select_account {
		border-bottom: 1px solid #efefef;
		display: flex;
		justify-content: flex-end;
		align-items: center;
		height: 65rpx;
		padding-right: 18rpx;
	}

	.order .select_account text {
		color: grey;
		display: inline-block;
		margin-left: 10rpx;
	}

	.order .select_account .uni-icons {
		color: grey !important;
	}

	.order .account_info {
		background: white;
		position: fixed;
		width: 100%;
		z-index: 2;
	}

	.order .s-tabs-nav-wrap .s-tab-nav-view {
		height: 100%;
		display: flex;
		justify-content: space-around;
	}

	.order .order_option {
		border-top: 1px solid #efefef;
		height: 96rpx;
		line-height: 96rpx;
		text-align: right;
		padding-right: 20rpx;
	}

	.order .order_option text {
		border-radius: 23rpx;
		width: 140rpx;
		display: inline-block;
		height: 46rpx;
		line-height: 46rpx;
		margin-left: 20rpx;
		font-size: 26rpx;
		text-align: center;
	}

	.order .another_order {
		background: white;
		color: #FF3333;
		border: 1px solid #F33;
	}

	.order .look_logist {
		background: rgb(2, 177, 228);
		color: white;
	}

	.order .cancel_order {
		background: white;
		color: #333;
		border: 1px solid #333;
	}

	.confirm_good {
		background: red;
		color: white;
		// border: 1px solid red;
	}

	.order .order_img {
		width: 208rpx;
		height: 208rpx;
		margin-right: 30rpx;
		border-radius: 10rpx;
	}

	.time {
		padding: 0 30rpx 28rpx;
		margin-top: -46rpx;
	}

	.order .order_info .content>view {
		background: white;
		margin: 30rpx 30rpx 0;

		border-radius: 10rpx;
	}

	.order .order_info .content .top {
		padding: 0 20rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
		height: 60rpx;
	}

	.order .order_info .content .detail {
		padding: 20rpx 20rpx 0;
		// border-top: 1px solid #efefef;
	}

	.order .order_statu .mask {
		position: fixed;
		top: 0;
		left: 0;
		z-index: 999;
		width: 100%;
		height: 100%;
		background-color: rgba(0, 0, 0, .5);
	}

	.order .order_statu .operate {
		margin-top: 10rpx;
		padding: 2px 0 0;
		z-index: 9999;
		border-radius: 2px;
		position: fixed;
		right: 20rpx;
		color: $m-c;
		background: #fff;
		width: 25%;
	}

	.order .order_statu .operate>view {
		height: 64rpx;
		line-height: 64rpx;
		text-align: center;
	}

	.order .order_statu .operate .all_order {
		border-bottom: 1px solid #efefef;
	}

	.order .custom-tabs {

		// padding: 0 30rpx;
		/deep/.s-tab-nav-view {
			display: flex;
			justify-content: space-between;
		}

		/deep/ .s-tab-nav {
			padding: 0;
		}
	}

	.order .bitmap {
		text-align: center;
	}

	.order .bitmap image {
		width: 60%;
		height: 500rpx;
		margin: 200rpx 0 0;
	}

	.order .order_oneline {
		flex: 1;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
	}

	/deep/ .s-tabs .s-tab-line {
		bottom: 1rpx;
		border-radius: 10rpx;
	}

	/deep/ .s-tab-nav {
		color: #000;
	}
</style>